package com.sunmnet.j2ee.entity.powerdb.designer;

import com.sunmnet.j2ee.entity.base.BaseAutoEntity;
import org.apache.commons.lang.builder.ReflectionToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;

@Entity
@Table(name = "pdm_database")
@DynamicInsert(true)
@DynamicUpdate(true)
public class Database extends BaseAutoEntity implements Serializable {

    private static final long serialVersionUID = 7741083835622990750L;

    private String databaseCode;

    private String name;

    private String nameCn;

    private String script;

    private Long createAccountId;

    private Long modifyAccountId;

    private Long versionId;

    @Column(name = "version_id")
    public Long getVersionId() {
        return versionId;
    }

    public void setVersionId(Long versionId) {
        this.versionId = versionId;
    }

    @Column(name = "database_code")
    public String getDatabaseCode() {
        return databaseCode;
    }

    public void setDatabaseCode(String databaseCode) {
        this.databaseCode = databaseCode;
    }

    @Column(name = "name")
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Column(name = "name_cn")
    public String getNameCn() {
        return nameCn;
    }

    public void setNameCn(String nameCn) {
        this.nameCn = nameCn;
    }

    @Column(name = "script")
    public String getScript() {
        return script;
    }

    public void setScript(String script) {
        this.script = script;
    }

    /**
     * get createAccountId
     *
     * @return java.lang.Long
     */
    @Column(name = "create_account_id")
    public Long getCreateAccountId() {
        return createAccountId;
    }

    /**
     * set createAccountId
     */
    public void setCreateAccountId(Long createAccountId) {
        this.createAccountId = createAccountId;
    }

    /**
     * get modifyAccountId
     *
     * @return java.lang.Long
     */
    @Column(name = "modify_account_id")
    public Long getModifyAccountId() {
        return modifyAccountId;
    }

    /**
     * set modifyAccountId
     */
    public void setModifyAccountId(Long modifyAccountId) {
        this.modifyAccountId = modifyAccountId;
    }

    @Override
    public String toString() {
        return new ReflectionToStringBuilder(
                this,
                ToStringStyle.DEFAULT_STYLE)
                .toString();
    }
}
